package com.neusoft.neumooc.controller.front;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.neusoft.core.common.BaseController;
import com.neusoft.core.common.pagination.Paginating;
import com.neusoft.neumooc.service.front.ContentManageService;
import com.neusoft.neumooc.vo.ContentVO;


/** 
 * @ClassName: FooterController 
 * @Description: TODO 尾部声明管理控制类
 * @author huangruijin
 * @date 2016年8月26日
 */
@RequestMapping(value = "/footer")
@Controller
public class FooterController extends BaseController {

	/** 
	 * @Fields contentManageService : TODO 内容管理服务接口实现类
	 */ 
	@Autowired
	ContentManageService contentManageService;;
	
	/**
	 * @Title: contentList
	 * @Description: 内容列表
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/contentList")
	@ResponseBody
	public Map<String, Object> contentList(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String columnId = request.getParameter("columnsId");
		Map<String, String> params = new HashMap<String, String>();
		Paginating page = getPaginating(request);
		this.loadPagination(params, page);

		List<ContentVO> contentList = contentManageService.getContentList(
				columnId, page.getPageIndex(), page.getPageSize());
		Map<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("rows", contentList);
		return resMap;
	}
}
